"""author: wenyao
   data: 2021/5/8
   project: devopscmdb
"""
#经典类与新式类的差异
#1、类型区别
#   经典类 通过type查看到的实例类型都叫instance
#          类与实例之间只有通过__class__属性进行关联
#   新式类 通过type查看到的实例类型是对象所对应的类名

#python2  经典类
# >>> class B: pass
# ...
# >>> b = B()
# >>> type(b)
# <type 'instance'>
# >>>
# >>> b.__class__
# <class __main__.B at 0x7f7cf3e62f30>
# >>> a.__class__
# <class __main__.A at 0x7f7cf3e62ec0>
# >>>

#2、继承顺序
#经典类：  深度优先
#新式类：  广度优先

class A:
    def test(self):
        print("from A")

class B(A):
    def test(self):
        print("from B")

class C(A):
    def test(self):
        print("from C")

class D(B):
    def test(self):
        print("from D")

class E(C):
    def test(self):
        print("from E")

class F(D,E):
    def test(self):
        print("from F")

f = F()
f.test()
#经典类  F ->  D ->B ->A ->E -C
#新式类  F ->D ->B -> E -> C -A